package com.eudon.design_pattern.behavioral.state.search_table;

import com.eudon.design_pattern.behavioral.state.search_table.mario_state.Event;
import com.eudon.design_pattern.behavioral.state.search_table.mario_state.MarioState;

/**
 * @author eudon
 * @description 使用示例
 * @date 2025/9/3
 * @email syd19970616@gmail.com
 * @address <a href="https://gitee.com/eudon">Gitee</a>
 */
public class Use {
    public static void main(String[] args) {
        MarioStateMachine machine = new MarioStateMachine(MarioState.SMALL);

        //1.遇到了蘑菇
        machine.eventExecute(Event.GET_MUSH_ROOM);
        System.out.println(machine.getMarioState());
        System.out.println(machine.getScore());
        //2.遇到了火焰
        machine.eventExecute(Event.GET_FIRE);
        System.out.println(machine.getMarioState());
        System.out.println(machine.getScore());
        //3.遇到了怪物
        machine.eventExecute(Event.MEET_MONSTER);
        System.out.println(machine.getMarioState());
        System.out.println(machine.getScore());
        //4.遇到了斗篷
        machine.eventExecute(Event.GET_CAPE);
        System.out.println(machine.getMarioState());
        System.out.println(machine.getScore());
    }
}
